package reflect;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class ReflectDemo3 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
        Class cls = Class.forName("reflect.Person");
        Constructor c = cls.getConstructor(String.class,Integer.TYPE);
        Object obj = c.newInstance("王五",44);
        System.out.println(obj);
    }
}
